<template>
	<div class="home">
		<el-container>
			<el-aside width="200px" style="background-color: #42B983;">
				<el-menu default-active="2" class="el-menu-vertical-demo" 
				@open="handleOpen" 
				@close="handleClose" 
				@select="handleSelect"
				background-color="#545c64"
					text-color="#fff" active-text-color="#ffd04b">
					<el-submenu index="1">
						<template slot="title">
							<i class="el-icon-location"></i>
							<span>面试模拟</span>
						</template>
						<el-menu-item-group>
							<el-menu-item index="1-1">面试问题</el-menu-item>
							<el-menu-item index="1-2">面试录入</el-menu-item>
						</el-menu-item-group>
					</el-submenu>

					<el-submenu index="2">
						<template slot="title">
							<i class="el-icon-menu"></i>
							<span>项目管理</span>
						</template>
						<el-menu-item-group>
							<el-menu-item index="1-1">选项1</el-menu-item>
							<el-menu-item index="1-2">选项2</el-menu-item>
							<el-menu-item index="1-3">选项3</el-menu-item>
							<el-menu-item index="1-3">选项3</el-menu-item>
						</el-menu-item-group>
					</el-submenu>
					
					<el-submenu index="3">
						<template slot="title">
							<i class="el-icon-document"></i>
							<span>简历管理</span>
						</template>
						<el-menu-item-group>
							<el-menu-item index="1-1">选项1</el-menu-item>
							<el-menu-item index="1-2">选项2</el-menu-item>
							<el-menu-item index="1-3">选项3</el-menu-item>
							<el-menu-item index="1-3">选项3</el-menu-item>
						</el-menu-item-group>
					</el-submenu>
					
					<el-submenu index="3">
						<template slot="title">
							<i class="el-icon-setting"></i>
							<span>导航一</span>
						</template>
						<el-menu-item-group>
							<el-menu-item index="1-1">选项1</el-menu-item>
							<el-menu-item index="1-2">选项2</el-menu-item>
							<el-menu-item index="1-3">选项3</el-menu-item>
							<el-menu-item index="1-3">选项3</el-menu-item>
						</el-menu-item-group>
					</el-submenu>
					
				</el-menu>
			</el-aside>
			<el-main>
				<router-view></router-view>
			</el-main>
		</el-container>
	</div>
</template>

<script>
	// @ is an alias to /src
	// import HelloWorld from '@/components/HelloWorld.vue'

	export default {
		name: 'Home',
		components: {
			// HelloWorld
		},
		methods: {
			handleOpen(key, keyPath) {
				console.log(key, keyPath);
			},
			handleClose(key, keyPath) {
				console.log(key, keyPath);
			},
			handleSelect(key, keyPath) {
				console.log("select"+keyPath);
				if(keyPath[1] == '1-1') {
					console.log("select-hello");
					this.$router.push("/askhr");
				}
				else if(keyPath[1] == '1-2'){
					this.$router.push("/askhredit");
				}
			}
		}
	}
</script>
